<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>QSChart.as</title>
<link rel="stylesheet" type="text/css" href="../../SourceStyles.css"/>
</head>

<body><pre><span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">components</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">AxisRenderer</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">CategoryAxis</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">ColumnChart</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">GridLines</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">HitData</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">LinearAxis</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">chartClasses</span>.<span class="ActionScriptDefault_Text">Series</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">ChartItemEvent</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptOperator">*</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">collections</span>.<span class="ActionScriptDefault_Text">ArrayCollection</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">graphics</span>.<span class="ActionScriptDefault_Text">SolidColor</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">graphics</span>.<span class="ActionScriptDefault_Text">Stroke</span>;
    
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">org</span>.<span class="ActionScriptDefault_Text">quantitativesustainability</span>.<span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">Styles</span>;

    <span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">QSChart</span> <span class="ActionScriptReserved">extends</span> <span class="ActionScriptDefault_Text">ColumnChart</span> <span class="ActionScriptReserved">implements</span> <span class="ActionScriptDefault_Text">QSChartInterface</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">styles</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Styles</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Styles</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_genInfo</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_discussion</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">genInfo</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">s</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_genInfo</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">s</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">genInfo</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_genInfo</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">discussion</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">s</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_discussion</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">s</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">discussion</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_discussion</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptComment">// AXES AND SERIES:
</span>        <span class="ActionScriptComment">// ... horizontal axis:
</span>        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">hax</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">CategoryAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">CategoryAxis</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptComment">// ... vertical series, their axes, and renderers:
</span>        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sTotalCost</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ColumnSeries</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ColumnSeries</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sCol</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ColumnSeries</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ColumnSeries</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxCol</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxRnCol</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sEF</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">PlotSeries</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">PlotSeries</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxEF</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxRnEF</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">sGen</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">PlotSeries</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">PlotSeries</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxGen</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">LinearAxis</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxRnGen</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">QSChart</span><span class="ActionScriptBracket/Brace">()</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">init</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">dpp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">dpp</span>;

            <span class="ActionScriptComment">// DATA-TIPS:
</span>            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataTipFunction</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">_dataTipFunction</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">showDataTips</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataTipMode</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;single&apos;</span>;
            <span class="ActionScriptComment">//this.itemClick=&quot;displayInfo(event)&quot;;
</span>
            <span class="ActionScriptComment">// HORIZONTAL AXIS:
</span>            <span class="ActionScriptDefault_Text">hax</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span>;
            <span class="ActionScriptDefault_Text">hax</span>.<span class="ActionScriptDefault_Text">categoryField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;label&apos;</span>;
            <span class="ActionScriptDefault_Text">hax</span>.<span class="ActionScriptDefault_Text">title</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;&apos;</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">horizontalAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">hax</span>;

            <span class="ActionScriptDefault_Text">render</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">addSeries</span><span class="ActionScriptBracket/Brace">()</span>; <span class="ActionScriptComment">// Also set visibility of series and axes;
</span>        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">addSeries</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// ADD SERIES:
</span>            <span class="ActionScriptComment">// ... cost:
</span>            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">id</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;sCol&apos;</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">xField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;label&apos;</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">yField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;cost&apos;</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">displayName</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;sCol&apos;</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;fill&apos;</span>, <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;stroke&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Stroke</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sb2_4</span><span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxCol</span>.<span class="ActionScriptDefault_Text">title</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Total cost  [ c$ / kWh ]&quot;</span>;
            <span class="ActionScriptDefault_Text">vaxCol</span>.<span class="ActionScriptDefault_Text">minimum</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptDefault_Text">sCol</span>.<span class="ActionScriptDefault_Text">verticalAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxCol</span>;

            <span class="ActionScriptComment">// ... totalCost:
</span>            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">xField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;label&apos;</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">yField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;totalCost&apos;</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">minField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;cost&apos;</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">displayName</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;sTotalCost&apos;</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;fill&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">SolidColor</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sb2_3</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">sTotalCost</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;stroke&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Stroke</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sb2_3</span><span class="ActionScriptBracket/Brace">))</span>;

            <span class="ActionScriptComment">// ... emissionFactor
</span>            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">xField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;label&apos;</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">yField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;emissionFactor&apos;</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;stroke&apos;</span>, <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">displayName</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;sGen&apos;</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;fill&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">SolidColor</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_0</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxEF</span>.<span class="ActionScriptDefault_Text">title</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Emission factor  [ kg CO2 / kWh ]&quot;</span>;
            <span class="ActionScriptDefault_Text">vaxEF</span>.<span class="ActionScriptDefault_Text">minimum</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">verticalAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxEF</span>;
            <span class="ActionScriptDefault_Text">sEF</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;

            <span class="ActionScriptComment">// ... generation 
</span>            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">dataProvider</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">xField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;label&apos;</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">yField</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;generation&apos;</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;stroke&apos;</span>, <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">displayName</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;sGen&apos;</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;fill&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">SolidColor</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_1</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxGen</span>.<span class="ActionScriptDefault_Text">title</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Generation  [ TWh / day ]&quot;</span>;
            <span class="ActionScriptDefault_Text">vaxGen</span>.<span class="ActionScriptDefault_Text">minimum</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">verticalAxis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxGen</span>;
            <span class="ActionScriptDefault_Text">sGen</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;

            <span class="ActionScriptComment">// ... add to graph:
</span>            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">series</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sCol</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sTotalCost</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sEF</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">sGen</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">series</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">series</span>;

        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">render</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// Get rid of shadows:
</span>            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">seriesFilters</span><span class="ActionScriptOperator">=</span><span class="ActionScriptBracket/Brace">[]</span>;

            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;overlaid&apos;</span>;

            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">gl</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">GridLines</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">GridLines</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">gl</span>.<span class="ActionScriptDefault_Text">y</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptDefault_Text">gl</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;direction&apos;</span>, <span class="ActionScriptString">&apos;horizontal&apos;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">gl</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;verticalShowOrigin&apos;</span>, <span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">gl</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;horizontalStroke&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">st_gridlines</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">gl</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;horizontalOriginStroke&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">st_origin</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">bge</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">bge</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">gl</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">backgroundElements</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">bge</span>;

            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">ar</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">AxisRenderer</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">ar</span>.<span class="ActionScriptDefault_Text">axis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">hax</span>;
            <span class="ActionScriptDefault_Text">ar</span>.<span class="ActionScriptDefault_Text">placement</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;bottom&apos;</span>;
            <span class="ActionScriptDefault_Text">ar</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;axisStroke&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">st_axis</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">ar</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;tickPlacement&apos;</span>, <span class="ActionScriptString">&apos;none&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptComment">// BODGE: This is deprecated, but adding to &apos;horizontalAxisRenderers&apos; adds an 
</span>            <span class="ActionScriptComment">// axis rather than modifying the existing one. 
</span>            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">horizontalAxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">ar</span>;
            <span class="ActionScriptComment">//this.horizontalAxisRenderers = har;
</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">vaxrs</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;

            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">axis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxCol</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">placement</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;left&apos;</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;axisStroke&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Stroke</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sb2_4</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;tickPlacement&apos;</span>, <span class="ActionScriptString">&apos;none&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;verticalAxisTitleAlignment&apos;</span>, <span class="ActionScriptString">&apos;vertical&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;labelGap&apos;</span>, 8<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnCol</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;color&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sb2_4</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxrs</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">vaxRnCol</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">axis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxEF</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">placement</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;right&apos;</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;axisStroke&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Stroke</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_2</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;tickPlacement&apos;</span>, <span class="ActionScriptString">&apos;none&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;verticalAxisTitleAlignment&apos;</span>, <span class="ActionScriptString">&apos;vertical&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;labelGap&apos;</span>, 8<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnEF</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;color&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_2</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxrs</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">vaxRnEF</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">axis</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxGen</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">placement</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;right&apos;</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;axisStroke&apos;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Stroke</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_1</span>, 1<span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;tickPlacement&apos;</span>, <span class="ActionScriptString">&apos;none&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;verticalAxisTitleAlignment&apos;</span>, <span class="ActionScriptString">&apos;vertical&apos;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;labelGap&apos;</span>, 8<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxRnGen</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&apos;color&apos;</span>, <span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">c_sg0_1</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">vaxrs</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">vaxRnGen</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptComment">// BODGE: Gotta set the following to get rid of the default axis....?
</span>            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">verticalAxisRenderer</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxrs</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">verticalAxisRenderers</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">vaxrs</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">updateCarbonPrice</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span> <span class="ActionScriptReserved">in</span> <span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span>.<span class="ActionScriptDefault_Text">totalCost</span><span class="ActionScriptOperator">=</span>
                    <span class="ActionScriptComment">// c$
</span>                    <span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span>.<span class="ActionScriptDefault_Text">cost</span>
                    <span class="ActionScriptComment">// [kg / kWh] * [$ / ton] * {100 [c$ / $] * 1e-3 [ton / kg]}  
</span>                    <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">dataProvider</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span>.<span class="ActionScriptDefault_Text">emissionFactor</span> <span class="ActionScriptOperator">*</span> <span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">*</span> 0.1;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">showSeries</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">a</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">AxisRenderer</span>, <span class="ActionScriptDefault_Text">s</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Series</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">a</span>.<span class="ActionScriptDefault_Text">visible</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">true</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">s</span>.<span class="ActionScriptDefault_Text">visible</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">true</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">a</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                <span class="ActionScriptDefault_Text">s</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">a</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                <span class="ActionScriptDefault_Text">s</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">_dataTipFunction</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hd</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">HitData</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">element</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">sCol</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">element</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">sTotalCost</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;&lt;b&gt;Cost  [ &amp;#162; / kWh ]&lt;/b&gt;&lt;br&gt;------------------------\n&apos;</span>;
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">+=</span><span class="ActionScriptString">&quot;Raw cost = &lt;i&gt;&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">cost</span>.<span class="ActionScriptDefault_Text">toPrecision</span><span class="ActionScriptBracket/Brace">(</span>3<span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&apos;&lt;/i&gt;\n&apos;</span>;
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">+=</span><span class="ActionScriptString">&quot;Carbon cost = &lt;i&gt;&quot;</span> <span class="ActionScriptOperator">+</span>
                    <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">totalCost</span> <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">cost</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">toPrecision</span><span class="ActionScriptBracket/Brace">(</span>3<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">+</span>
                    <span class="ActionScriptString">&apos;&lt;/i&gt;\n&apos;</span>;
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">+=</span><span class="ActionScriptString">&apos;&lt;b&gt;Total cost&lt;/b&gt; = &lt;i&gt;&apos;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">totalCost</span>.<span class="ActionScriptDefault_Text">toPrecision</span><span class="ActionScriptBracket/Brace">(</span>3<span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">+</span>
                    <span class="ActionScriptString">&apos;&lt;/i&gt;\n&apos;</span>;
                <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">rtVal</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">element</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">sEF</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;&lt;b&gt;Emission factor&lt;/b&gt; = &apos;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">emissionFactor</span>;
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">+=</span><span class="ActionScriptString">&apos; [ kg CO2 / kWh ]&apos;</span>;
                <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">rtVal</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">element</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">sGen</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;&lt;b&gt;Generation quantity&lt;/b&gt; = &apos;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">hd</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">generation</span>;
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">+=</span><span class="ActionScriptString">&apos; [ TWh / day ]&apos;</span>;
                <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">rtVal</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptString">&apos;&apos;</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getChartItemInfo</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ChartItemEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;&lt;i&gt;No further information.&lt;/i&gt;&apos;</span>;
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>.<span class="ActionScriptDefault_Text">hitData</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">info</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">rtVal</span><span class="ActionScriptOperator">=</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>.<span class="ActionScriptDefault_Text">hitData</span>.<span class="ActionScriptDefault_Text">item</span>.<span class="ActionScriptDefault_Text">info</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">rtVal</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span> <span class="ActionScriptComment">//Class.
</span><span class="ActionScriptBracket/Brace">}</span></pre></body>
</html>
